import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { CommonModule } from '@angular/common';
import { HomeComponent } from './pages/home/home.component';
import { CategoryComponent } from './pages/category/category.component';
import { ViewComponent } from './pages/view/view.component';
import { SearchComponent } from './pages/search/search.component';
import { QianggouComponent } from './pages/qianggou/qianggou.component';
import { SuperCouponComponent } from './pages/super-coupon/super-coupon.component';
const routes: Routes = [
  { path: '', redirectTo: '/home', pathMatch: 'full' },
  { path: 'home',  component: HomeComponent },
  { path: 'category/:id', component: CategoryComponent },
  { path: 'search/:query', component: SearchComponent },
  { path: 'super', component: SuperCouponComponent },
  { path: 'super/:query', component: SuperCouponComponent },
  { path: 'view/:id',     component: ViewComponent },
  { path: 'qianggou',     component: QianggouComponent }
];


@NgModule({
  imports: [ RouterModule.forRoot(routes) ],
  exports: [ RouterModule ]
})
export class AppRoutingModule {}
